<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>发布 - 知猿社区</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <link rel="stylesheet" href="/nodeModules/bootstrap/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="/nodeModules/bootstrap/dist/css/bootstrap-theme.min.css">
    <link rel="stylesheet" href="/nodeModules/css/community.css">
    <link rel="stylesheet" href="/nodeModules/editor.md/css/editormd.min.css">
    <script src="/nodeModules/jquery/dist/jquery.min.js"></script>
    <script src="/nodeModules/bootstrap/dist/js/bootstrap.min.js"></script>
    <script src="/nodeModules/js/community.js"></script>
    <script src="/nodeModules/editor.md/editormd.min.js"></script>
</head>
<body>
<div th:insert="~{navigation :: nav}"></div>

<div class="container main">
    <div class="row">
        <div class="col-lg-9 col-md-12 col-sm-12 col-xs-12" style="border-right:1px solid #DDDDDD;">
            <!--头部发起-->
            <ul class="nav  nav-tabs active" role="tablist">
                <li role="presentation" class="active nav-tabs-li"><a href="#questionHome" aria-controls="indexHome"
                                                                      role="tab"
                                                                      style="color: #666"
                                                                      data-toggle="tab">问题</a></li>
                <h2 class="nav-tabs-h2"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span>发起</h2>
            </ul>
            <!--下面输入框-->
            <div class="tab-content" style="padding: 10px 0 0 5px">
                <div role="tabpanel" class="tab-pane active" id="questionHome">
                    <form action="/publish" method="post">
                        <input type="hidden" name="id" th:value="${id}">
                        <div class="form-group">
                            <label for="title">问题标题 (简答扼要)：</label>
                            <input type="text" th:value="${title}" class="form-control" id="title" name="title"
                                   placeholder="问题标题...."
                                   autocomplete="off">
                        </div>
                        <div class="form-group" id="question-editor">
                            <label for="description" style="margin-bottom: 20px">问题补充 (必须，请参照右侧提示)：</label>
                            <textarea name="description" th:text="${description}" id="description" class="form-control"
                                      style="display:none;"
                                      cols="30" rows="10"></textarea>
                        </div>
                        <script type="text/javascript">
                            $(function () {
                                var editor = editormd("question-editor", {
                                    width: "100%",
                                    height: "400px",
                                    path: "/nodeModules/editor.md/lib/",
                                    delay: 0,
                                    watch: false,
                                    placeholder: "请输入问题描述",
                                    imageUpload: true,
                                    imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp"],
                                    imageUploadURL: "/file/upload"
                                });
                            });
                        </script>
                        <div class="form-group">
                            <label for="tag">添加标签:</label>
                            <input type="text" class="form-control" th:value="${tag}" id="tag" name="tag"
                                   autocomplete="off"
                                   placeholder="输入标签，以,号分隔" onclick="showSelectTag()">
                            <div>
                                <div id="select-tag" class="publish-tag-tab">
                                    <!-- 添加标签 标签头-->
                                    <ul class="nav nav-tabs" role="tablist">
                                        <li role="presentation" th:each="selectCategory,selectCatrgoryStat:${tags}"
                                            th:class="${selectCatrgoryStat.first ?'active':''}">
                                            <a th:href="${'#'+selectCategory.categoryName}" aria-controls="home"
                                               role="tab"
                                               data-toggle="tab" th:text="${selectCategory.categoryName}"></a></li>
                                    </ul>

                                    <!-- 添加标签 标签 -->
                                    <div class="tab-content">
                                        <div role="tabpanel" th:id="${selectCategory.categoryName}"
                                             th:each="selectCategory,selectCatrgoryStat:${tags}"
                                             th:class="${selectCatrgoryStat.first ?'active tab-pane':'tab-pane'}">
                                    <span>
                                        <span class="label label-info" th:each="selectTag:${selectCategory.tags}">
                                        <span class="glyphicon glyphicon-tags" onclick="selectTag(this)"
                                              th:data-tag="${selectTag}"
                                              th:text="${'&nbsp;'+selectTag}">

                                        </span>
                                    </span>
                                    </span>

                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="container-fluid main">
                            <div class="row">
                                <div class="col-lg-9 col-md-12 col-sm-12 col-xs-12">
                                    <div class="alert alert-danger col-lg-12 col-md-12 col-sm-12 col-xs-12"
                                         th:text="${error}"
                                         th:if="${error != null}"></div>
                                </div>
                                <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12">
                                    <button type="submit"
                                            class="btn btn-success btn-publish">发布
                                    </button>
                                </div>
                            </div>
                        </div>

                    </form>
                </div>
            </div>


        </div>
        <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12 publish-aside-questionsend">
            <h4>问题发起指南</h4>
            <div>
                <p>• 问题标题: 请用<b style="color: red">精简</b>的语言描述您发布的问题，不超过25字</p>
                <p>• 问题补充: <b style="color: red">详细</b>补充您的问题内容，并确保问题描述清晰直观, 并提供一些相关的资料</p>
                <li>服务器运行环境信息；</li>
                <li>软件版本；</li>
                <li>问题发生的上下文信息；</li>
                <li>可以完整复现问题的代码（如可直接运行于 Kibana Console 的复现流程）；</li>
                <li>补充完整的异常和错误信息；</li>
                <li>注意阅读格式友好，代码和异常信息请用代码标签格式化张贴；</li>
                <p></p>
                <p>• 选择标签: 选择一个或者多个合适的标签</p>
            </div>
        </div>
    </div>
</div>
<!--底部-->
<div th:insert="~{footer :: foot}"></div>
</body>

</html>